Inductive and Coinductive types with Iteration and Recursion in a Polymorphic Framework

نویسنده

  • Herman Geuvers
چکیده

We study (extensions of) polymorphic typed lambda calculus from a point of view of how iterative and recursive functions on inductive types are represented. The inductive types can usually be understood as initial algebras in a certain category and then recursion can be defined in terms of iteration. However, in the syntax we often have only weak initiality, which makes the definition of recursion in terms of iteration inefficient or just impossible. We propose a categorical notion of (primitive) recursion which can easily be added as computation rule to a typed lambda calculus and gives us a clear view on what the dual of recursion, corecursion, on coinductive types is. (The same notion has, independently, been proposed by [Mendler 1991].) We then look at how these syntactic notions work out in the framework of K-models for polymorphic lambda calculus. It will turn out that with some quite weak extra assumptions, recursion can be defined in terms of corecursion and vice versa using polymorphism. This also works syntactically: We shall look at some slight extensions of polymorphic lambda calculus for which a scheme for either recursion or corecursion suffices to be able to define the other. As an application of this we look at the Calculus of Inductive Definitions ([Coquand and Mohring 1990] and [Dowek e.a. 1991]), which reflects our categorical notion of recursion and we show how to define coinductive types with corecursion in it.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Two Extensions of System F with (co)iteration and Primitive (co)recursion Principles

This paper presents two extensions of the second order polymorphic lambda calculus F with inductive and coinductive types including not only (co)iteration but primitive (co)recursion and inversion principles. The systems are proven to be safe, can be seen as extensions of Hagino’s categorical lambda calculus and are also related with the systems of higher-order iterators of [1]. 1991 Mathematic...

متن کامل

The Church-Scott representation of inductive and coinductive data

Data in the lambda calculus is usually represented using the "Church encoding", which gives closed terms for the constructors and which naturally allows to define functions by iteration. An additional nice feature is that in system F (polymorphically typed lambda calculus) one can define types for this data and the iteration scheme is well-typed. A problem is that primitive recursion is not dir...

متن کامل

Mixed Inductive/Coinductive Types and Strong Normalization

We introduce the concept of guarded saturated sets, saturated sets of strongly normalizing terms closed under folding of corecursive functions. Using this tool, we can model equi-inductive and equicoinductive types with terminating recursion and corecursion principles. Two type systems are presented: Mendler (co)iteration and sized types. As an application we show that we can directly represent...

متن کامل

Inductive and Coinductive Session Types in Higher-Order Concurrent Programs

We develop a theory of inductive and coinductive session types in a computational interpretation of linear logic, enabling the representation of potentially infinite interactions in a compositionally sound way that preserves logical soundness, a major stepping stone towards a full dependent type theory for expressing and reasoning about session-based concurrent higher order distributed programs...

متن کامل

Monotone ( Co ) Inductive Types and Fixed - Point Types

We study ve extensions of the polymorphically typed lambda-calculus (system F) by type constructs intended to model xed-points of monotone operators. Building on work by H. Geuvers concerning the relation between term rewrite systems for least pre-xed-points and greatest post-xed-points of positive type schemes (i. e., non-nested positive inductive and coinductive types) and so-called retract t...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2015